import { makeAutoObservable } from "mobx";
// import { http } from '@/utils'
import { getToken, setToken, http } from "@/utils";
class loginStore {
    token = getToken()||''
    constructor(){
      makeAutoObservable(this)
    }
    // 登录
    login = async ({mobile,code}) => {
      const res = await http.post('http://geek.itheima.net/v1_0/authorizations', {
        mobile,
        code
      })
      this.token = res.data.data.token
      setToken(this.token)
  }
}
export default loginStore
